//
//  UIView+Extension.h
//  YLProject
//
//  Created by YuanGu on 2018/1/11.
//  Copyright © 2018年 WY. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Extension)

/**
 * @brief Shortcut for frame.origin.x.
 *        Sets frame.origin.x = originX
 */
@property (nonatomic) CGFloat originX;

/**
 * @brief Shortcut for frame.origin.y
 *        Sets frame.origin.y = originY
 */
@property (nonatomic) CGFloat originY;

/**
 * @brief Shortcut for frame.origin.x + frame.size.width
 *       Sets frame.origin.x = rightX - frame.size.width
 */
@property (nonatomic) CGFloat maxX;

/**
 * @brief Shortcut for frame.origin.y + frame.size.height
 *        Sets frame.origin.y = bottomY - frame.size.height
 */
@property (nonatomic) CGFloat maxY;

/**
 * @brief Shortcut for frame.size.width
 *        Sets frame.size.width = width
 */
@property (nonatomic) CGFloat width;

/**
 * @brief Shortcut for frame.size.height
 *        Sets frame.size.height = height
 */
@property (nonatomic) CGFloat height;

/**
 * @brief Shortcut for center.x
 * Sets center.x = centerX
 */
@property (nonatomic) CGFloat centerX;

/**
 * @brief Shortcut for center.y
 *        Sets center.y = centerY
 */
@property (nonatomic) CGFloat centerY;

/**
 * @brief Shortcut for frame.origin
 */
@property (nonatomic) CGPoint origin;

/**
 * @brief Shortcut for frame.size
 */
@property (nonatomic) CGSize size;


/**
 *  绘制渐变 效果
 *
 *  @param color 渐变颜色
 *  @param isHorizontal 是否水平渐变
 */
- (void)graidentLayerWithColor:(UIColor *)color isHorizontal:(BOOL)isHorizontal;

/**
 *  绘制圆角
 *
 *  @param radiu 圆角半径
 */
- (void)cornerLayerWithRadiu:(CGFloat)radiu;

/**
 *  绘制边缘线条
 *
 *  @param rect 线条frame
 *  @param color 线条颜色
 */
- (void)borderLineLayerWithRect:(CGRect)rect color:(UIColor *)color;


/**
 *  绘制圆角边框
 *
 *  @param radiu 圆角半径
 *  @param color 边框颜色
 *  @param width 边框宽度
 */
- (void)borderLineAllCornerLayerWith:(CGFloat)radiu color:(UIColor *)color lineWidth:(CGFloat)width;

@end

